package com.zju.DoctorGo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zju.DoctorGo.dto.BookingFilterDTO;
import com.zju.DoctorGo.entity.Booking;
import com.zju.DoctorGo.mapper.BookingMapper;
import com.zju.DoctorGo.service.BookingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookingServiceImpl extends ServiceImpl<BookingMapper, Booking> implements BookingService {

    @Autowired
    private BookingMapper bookingMapper;

    @Override
    public List<Booking> getBookings(BookingFilterDTO filter) {
        return bookingMapper.selectByFilter(filter);
    }

    @Override
    public void addBooking(Booking booking) {
        bookingMapper.insert(booking);
    }

    @Override
    public void deleteBooking(List<Long> bookingIds) {
        System.out.println(bookingIds);
        bookingMapper.deleteBatchIds(bookingIds);
    }
}
